<?php

     session_start();
     include('common.php');

    if (session_is_registered(MySBB_Admin_username) and $member_permission == 1)
    {

// **  **

         if ($groupper_row['admincp_adminstep'] != 1)
         {
             $SF->error('المعذره .. هذه الميزه غير متاحه لك !');
         }

// **  **

         if ($_GET['supermember'] == 1)
         {
             if ($_GET['option'] == 1)
             {
                 if ($_GET['main'] == 1)
                 {
                     $SF->Make_cplink_path('متابعة المشرفين');
                     $Smarty->display('logs_supermember_main.tpl');
                 }

                 if ($_GET['start'] == 1)
                 {
                     $update = $DB->sql_query("UPDATE " . $db_prefix . "info SET supermember_logs='" . $_POST['D1'] . "'");
                     if ($update)
                     {
                         $SF->msg('تم التحديث بنجاح !');
                         $SF->go_to('logs.php?supermember=1&option=1&main=1',2);
                     }
                 }
             }

             if ($_GET['logs'] == 1)
             {
                 $SF->Make_cplink_path("<a href='logs.php?supermember=1&option=1&main=1'>متابعة المشرفين</a> -> الاطلاع على السجلات");

                 $getlogs_query = $DB->sql_query("SELECT * FROM " . $db_prefix . "supermemberlogs ORDER BY id DESC");
                 $getlogs_num   = $DB->sql_num_rows($getlogs_query);

                 if ($getlogs_num <= 0)
                 {
                     $SF->msg('لا يوجد سجلات');
                 }

                 $getlogs_rows = array();
                 while ($getlogs_row = $DB->sql_fetch_array($getlogs_query))
                 {
                     $getlogs_rows[] = $getlogs_row;
                     $Smarty->assign('getlogs_rows',$getlogs_rows);
                 }

                 $Smarty->display('logs_supermember_logs.tpl');
             }
         }

// **  **

         if ($_GET['del'] == 1)
         {
             $del = $DB->sql_query("DELETE FROM " . $db_prefix . "supermemberlogs");
             if ($del)
             {
                 $SF->msg('تم الحذف بنجاح !');
                 $SF->go_to('logs.php?supermember=1&logs=1',2);
             }
         }

// **  **

    }

?>